package DigitalEncryption;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        int[] arr = new int[4];
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入密码");
        int n = scanner.nextInt();
        arr[0] = n/1000;
        arr[1] = n/100%10;
        arr[2] = n/10%10;
        arr[3] = n%10;
        for(int i=0;i<arr.length;i++)
        {
            arr[i]+=5;
            arr[i]%=10;
        }
        int left = 0;
        int right = arr.length-1;
        while(left<right)
        {
            int tmp = arr[left];
            arr[left] = arr[right];
            arr[right] = tmp;
            left++;
            right--;
        }
        System.out.println("新的密码是");
        for(int i=0;i<arr.length;i++)
        {
            System.out.print(arr[i]);
        }
    }
}
